<?php
(new \Phalcon\Debug())->listen(true, true);

/**
 * The FactoryDefault Dependency Injector automatically registers the services that
 * provide a full stack framework. These default services can be overidden with custom ones.
 */
$di = new \Phalcon\Di\FactoryDefault();

/**
 * Include general services
 */
require SRC_PATH . 'config'.DS.'services.php';

/**
 * Include web environment specific services
 */
require SRC_PATH . 'config/services_web.php';

$application = new \Phalcon\Mvc\Application($di);

$application -> registerModules([
  'home' => [
    'className' => 'Modules\\Home\\Module',
    'path' => __DIR__ . '/modules/home/Module.php'
  ],
  'admin' => [
    'className' => 'Modules\\Admin\\Module',
    'path' => __DIR__ . '/modules/admin/Module.php'
  ],
]);

$application -> handle() -> send();
/*
try {
  $application -> handle() -> send();
} catch (\Exception $e) {
  echo $e->getMessage();
}
*/
?>